package com.tiancheng.onecode.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @Author: kellen
 * @Description: 子订单维度-账单
 * @Date: create in 2024/12/17 14:45
 */
@Data
@TableName(value = "bill")
public class Bill implements Serializable {
    /**
     * 主键id
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 账单编码
     */
    private String billNo;
    /**
     * 账单类型：0-支付账单，1-退款账单
     */
    private Integer billType;
    /**
     * 订单id
     */
    private String orderId;
    /**
     * 子订单订单id
     */
    private String subOrderId;
    /**
     * 子支付流水号
     */
    private String subFlowId;
    /**
     * 订单总价
     */
    private Integer totalAmount;
    /**
     * 实付总价
     */
    private Integer payAmount;
    /**
     * 优惠金额
     */
    private Integer discount;
    /**
     * 总退款金额
     */
    private Integer refundTotalAmount;
    /**
     * 实退金额
     */
    private Integer refundAmount;
    /**
     * 退优惠金额
     */
    private Integer refundDiscountAmount;
    /**
     * 清分金额
     */
    private Integer settleAmount;
    /**
     * 佣金金额
     */
    private Integer platformAmount;
    /**
     * 商户金额
     */
    private Integer merchantAmount;
    /**
     * 清分规则
     */
    private String settleRule;
    /**
     * 平台分佣百分比值
     */
    private BigDecimal platformPercent;
    /**
     * 核销时间
     */
    private LocalDateTime verificationTime;
    /**
     * IN：核销中，SC成功，Fl：核销失败
     */
    private String verificationStatus;
    /**
     * 核销id
     */
    private String verificationId;
    /**
     * 应清日期
     */
    private LocalDate settleDate;
    /**
     * 清分成功日期
     */
    private LocalDate settleScDate;
    /**
     * 清分状态
     */
    private String settleStatus;
    /**
     * 账单备注
     */
    private String billRemark;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastUpdDt;
    /**
     * 账单生成日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdDt;
}
